From: Karl Heuer Date: Wed, 30 Mar 1994 02:21:19 +0000 (+0000) Subject: (rmail-sort-from-summary): Preserve window selection. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~92479 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=2a527e488c2a33001ddacbd19e4b5a717c651a4c;p=emacs.git (rmail-sort-from-summary): Preserve window selection. --- diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 4c502b27870..d15d4a2bf22 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -1111,8 +1111,10 @@ If prefix argument REVERSE is non-nil, sort them in reverse order." (defun rmail-sort-from-summary (sortfun reverse) "Sort Rmail messages from Summary buffer and update it after sorting." (require 'rmailsort) - (pop-to-buffer rmail-buffer) - (funcall sortfun reverse) - (rmail-summary)) + (let ((selwin (selected-window))) + (unwind-protect + (progn (pop-to-buffer rmail-buffer) + (funcall sortfun reverse)) + (select-window selwin)))) ;;; rmailsum.el ends here